﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
using Viki_DAL;
using Viki_IDal;

namespace Viki_DalFactory
{
    public static class DataAccess
    {
        
        private static readonly string path = "Viki_DAL";

       

        public static Viki_IDal.IUserDao CreateUserDao()
        {
            string className = path + ".UserDao";
            Assembly a = Assembly.Load(path);
            Viki_IDal.IUserDao ins = (Viki_IDal.IUserDao)a.CreateInstance(className);

            return ins;
        }
        public static Viki_IDal.IRegisterDao CreateRegisterDao()
        {
            string className = path + ".RegisterDao";
            Assembly a = Assembly.Load(path);
            Viki_IDal.IRegisterDao ins = (Viki_IDal.IRegisterDao)a.CreateInstance(className);

            return ins;
        }
        public static Viki_IDal.ITeacherDao CreateTeacherDao()
        {
            string className = path + ".TeacherDao";
            Assembly a = Assembly.Load(path);
            Viki_IDal.ITeacherDao ins = (Viki_IDal.ITeacherDao)a.CreateInstance(className);

            return ins;
        }
    }
    }


